/*  
 * Copyright 2007 MBARI 
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 */
package org.mbari.timeline.model;

import junit.framework.TestCase;

import org.mbari.timeline.DateUtil;
import org.mbari.timeline.model.MultipartEvent;

import com.domainlanguage.time.Duration;

/** 
 * @author Andrew Chase
 */
public class TestMultipartEvent extends TestCase {

	protected void setUp() throws Exception {
		MultipartEvent multipartEvent = new MultipartEvent(); 
		super.setUp();
	}

	public void testTwoPartEvent(){
		Duration duration1 = Duration.minutes(50);
		Duration duration2 = Duration.hours(3);
		MultipartEvent twoparter = MultipartEvent.twoPartEvent(DateUtil.BEGIN_2007, duration1, duration2);
		Duration summedDuration = duration1.plus(duration2);
		assertEquals(summedDuration, twoparter.getDuration());
		assertEquals(DateUtil.BEGIN_2007, twoparter.getTime());
	}
}
